﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SimpleRest.WebTest.Services
{
    public class Review
    {
        public string Id { get; set; }
        public string Url { get; set; }
        public string UserId { get; set; }
        public string EntityId { get; set; }
        public string ApplicationId { get; set; }
        public string ReviewUrl { get; set; }
        public string Language { get; set; }
        public string Rating { get; set; }
        public string Title { get; set; }
        public string Body { get; set; }
        public double Score { get; set; }
        public bool IsVisible { get; set; }

        private static Random rand = new Random();
        public static Review GetMock(string id = null)
        {
            if (string.IsNullOrWhiteSpace(id))
                id = Guid.NewGuid().ToString();
            Review item = new Review();

            item.Id = id;
            item.Url = "http://www." + Guid.NewGuid().ToString("N") + ".com";
            item.UserId = Guid.NewGuid().ToString();
            item.EntityId = Guid.NewGuid().ToString();
            item.ApplicationId = Guid.NewGuid().ToString();
            item.ReviewUrl = "https://www." + Guid.NewGuid().ToString("N") + ".net";
            item.Language = "EN";
            item.Rating = rand.Next(1, 10).ToString();
            item.Title = "My Title - " + Guid.NewGuid().ToString();
            item.Body = "My Body - " + Guid.NewGuid().ToString();
            item.Score = rand.Next(1, 1000) * rand.NextDouble();
            item.IsVisible = Convert.ToBoolean(rand.Next(0, 1));

            return item;
        }
    }
}